﻿using SD.Infrastructure.DTOBase;
using SlamDunk.MES.IAppService.DTOs.Outputs.DefinitionContext;
using SlamDunk.MES.IAppService.DTOs.Outputs.FoundationContext;
using SlamDunk.MES.IAppService.DTOs.Outputs.ResourceContext;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Runtime.Serialization;

namespace SlamDunk.MES.IAppService.DTOs.Outputs.PlanContext
{
    /// <summary>
    /// 作业计划数据传输对象
    /// </summary>
    [DataContract]
    public class ExecutionPlanInfo : BaseDTO
    {
        #region 生产批号 —— string ProductionBatchNo
        /// <summary>
        /// 生产批号
        /// </summary>
        [DataMember]
        public string ProductionBatchNo { get; set; }
        #endregion

        #region 预期开始时间 —— DateTime ExpStartTime
        /// <summary>
        /// 预期开始时间
        /// </summary>
        [DataMember]
        public DateTime ExpStartTime { get; set; }
        #endregion

        #region 预期结束时间 —— DateTime ExpEndTime
        /// <summary>
        /// 预期结束时间
        /// </summary>
        [DataMember]
        public DateTime ExpEndTime { get; set; }
        #endregion

        #region 最早开始时间 —— DateTime EarliestStartTime
        /// <summary>
        /// 最早开始时间
        /// </summary>
        [DataMember]
        public DateTime EarliestStartTime { get; set; }
        #endregion

        #region 最晚结束时间 —— DateTime LatestEndTime
        /// <summary>
        /// 最晚结束时间
        /// </summary>
        [DataMember]
        public DateTime LatestEndTime { get; set; }
        #endregion

        #region 实际开始时间 —— DateTime? ActualStartTime
        /// <summary>
        /// 实际开始时间
        /// </summary>
        [DataMember]
        public DateTime? ActualStartTime { get; set; }
        #endregion

        #region 实际结束时间 —— DateTime? ActualEndTime
        /// <summary>
        /// 实际结束时间
        /// </summary>
        [DataMember]
        public DateTime? ActualEndTime { get; set; }
        #endregion

        #region 产品Id —— Guid ProductId
        /// <summary>
        /// 产品Id
        /// </summary>
        [DataMember]
        public Guid ProductId { get; set; }
        #endregion

        #region 工艺Id —— Guid ProcessId
        /// <summary>
        /// 工艺Id
        /// </summary>
        [DataMember]
        public Guid ProcessId { get; set; }
        #endregion

        #region 物料清单Id —— Guid BomId
        /// <summary>
        /// 物料清单Id
        /// </summary>
        [DataMember]
        public Guid BomId { get; set; }
        #endregion

        #region 预期毛产量 —— decimal ExpGrossQuantity
        /// <summary>
        /// 预期毛产量
        /// </summary>
        [DataMember]
        public decimal ExpGrossQuantity { get; set; }
        #endregion

        #region 预期净产量 —— decimal ExpNetQuantity
        /// <summary>
        /// 预期净产量
        /// </summary>
        [DataMember]
        public decimal ExpNetQuantity { get; set; }
        #endregion

        #region 生产计划Id —— Guid? ProductionPlanId
        /// <summary>
        /// 生产计划Id
        /// </summary>
        [DataMember]
        public Guid? ProductionPlanId { get; set; }
        #endregion

        #region 工厂模型Id —— Guid? FacilityId 
        /// <summary>
        /// 工厂模型Id
        /// </summary>
        [DataMember]
        public Guid? FacilityId { get; set; }
        #endregion

        #region 优先级 —— int Priority
        /// <summary>
        /// 优先级
        /// </summary>
        /// <remarks>数值越大，优先级越高</remarks>
        [DataMember]
        public int Priority { get; set; }
        #endregion

        #region 作业计划状态 —— ExecutionPlanStatus Status
        /// <summary>
        /// 作业计划状态
        /// </summary>
        [DataMember]
        public ExecutionPlanStatus Status { get; set; }
        #endregion

        #region 是否已生成工单 —— bool HasGeneratedWorkOrders
        /// <summary>
        /// 是否已生成工单
        /// </summary>
        [DataMember]
        public bool HasGeneratedWorkOrders { get; set; }
        #endregion

        #region 是否已质检 —— bool HasInspected
        /// <summary>
        /// 是否已质检
        /// </summary>
        [DataMember]
        public bool HasInspected { get; set; }
        #endregion

        #region 异常原因 —— string ExceptionReason
        /// <summary>
        /// 异常原因
        /// </summary>
        [DataMember]
        public string ExceptionReason { get; set; }
        #endregion

        #region 提审人账号 —— string SubmitterAccount
        /// <summary>
        /// 提审人账号
        /// </summary>
        [DataMember]
        public string SubmitterAccount { get; set; }
        #endregion

        #region 提审人姓名 —— string SubmitterName
        /// <summary>
        /// 提审人姓名
        /// </summary>
        [DataMember]
        public string SubmitterName { get; set; }
        #endregion

        #region 审核状态 —— CheckStatus CheckStatus
        /// <summary>
        /// 审核状态
        /// </summary>
        [DataMember]
        public CheckStatus CheckStatus { get; set; }
        #endregion

        #region 审核意见 —— string CheckedRemark
        /// <summary>
        /// 审核意见
        /// </summary>
        [DataMember]
        public string CheckedRemark { get; set; }
        #endregion

        #region 审核人账号 —— string CheckerAccount
        /// <summary>
        /// 审核人账号
        /// </summary>
        [DataMember]
        public string CheckerAccount { get; set; }
        #endregion

        #region 审核人姓名 —— string CheckerName
        /// <summary>
        /// 审核人姓名
        /// </summary>
        [DataMember]
        public string CheckerName { get; set; }
        #endregion

        #region 审核时间 —— DateTime? CheckedTime
        /// <summary>
        /// 审核时间
        /// </summary>
        [DataMember]
        public DateTime? CheckedTime { get; set; }
        #endregion

        #region 创建人账号 —— string CreatorAccount
        /// <summary>
        /// 创建人账号
        /// </summary>
        [DataMember]
        public string CreatorAccount { get; set; }
        #endregion

        #region 创建人姓名 —— string CreatorName
        /// <summary>
        /// 创建人姓名
        /// </summary>
        [DataMember]
        public string CreatorName { get; set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        [DataMember]
        public string Description { get; set; }
        #endregion


        //导航属性

        #region 导航属性 - 产品 —— MaterialInfo ProductInfo
        /// <summary>
        /// 导航属性 - 产品
        /// </summary>
        [DataMember]
        public MaterialInfo ProductInfo { get; set; }
        #endregion

        #region 导航属性 - 工艺 —— ProcessInfo ProcessInfo
        /// <summary>
        /// 导航属性 - 工艺
        /// </summary>
        [DataMember]
        public ProcessInfo ProcessInfo { get; set; }
        #endregion

        #region 导航属性 - 生产计划 —— ProductionPlanInfo ProductionPlanInfo
        /// <summary>
        /// 导航属性 - 生产计划
        /// </summary>
        [DataMember]
        public ProductionPlanInfo ProductionPlanInfo { get; set; }
        #endregion

        #region 导航属性 - 物料清单 —— BomInfo BomInfo
        /// <summary>
        /// 导航属性 - 物料清单
        /// </summary>
        [DataMember]
        public BomInfo BomInfo { get; set; }
        #endregion

        #region 导航属性 - 工厂模型 —— FacilityInfo FacilityInfo
        /// <summary>
        /// 导航属性 - 工厂模型
        /// </summary>
        [DataMember]
        public FacilityInfo FacilityInfo { get; set; }
        #endregion
    }
}
